<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: eosio::price&lt; BaseToken, QuoteToken &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceeosio.html">eosio</a></li><li class="navelem"><a class="el" href="structeosio_1_1price.html">price</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="structeosio_1_1price-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">eosio::price&lt; BaseToken, QuoteToken &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__contractdev.html">Smart Contract API Reference</a> &raquo; <a class="el" href="group__tokens.html">Token API</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Defines a fixed precision price between two tokens.  
 <a href="structeosio_1_1price.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="token_8hpp_source.html">token.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a50171d60c92837867ed507a247d8a550"><td class="memItemLeft" align="right" valign="top">typedef BaseToken&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#a50171d60c92837867ed507a247d8a550">base_token_type</a></td></tr>
<tr class="separator:a50171d60c92837867ed507a247d8a550"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef7d0e4f45187d59ebc40b0d91a1d358"><td class="memItemLeft" align="right" valign="top">typedef QuoteToken&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#aef7d0e4f45187d59ebc40b0d91a1d358">quote_token_type</a></td></tr>
<tr class="separator:aef7d0e4f45187d59ebc40b0d91a1d358"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1883a4c7ea7945e3b9adc6e0ad935fa6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#a1883a4c7ea7945e3b9adc6e0ad935fa6">price</a> ()</td></tr>
<tr class="memdesc:a1883a4c7ea7945e3b9adc6e0ad935fa6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#a1883a4c7ea7945e3b9adc6e0ad935fa6">More...</a><br /></td></tr>
<tr class="separator:a1883a4c7ea7945e3b9adc6e0ad935fa6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af19e574e7316fa0cb506f433a2b266f1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#af19e574e7316fa0cb506f433a2b266f1">price</a> (BaseToken base, QuoteToken quote)</td></tr>
<tr class="memdesc:af19e574e7316fa0cb506f433a2b266f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construction for price given the base token and quote token.  <a href="#af19e574e7316fa0cb506f433a2b266f1">More...</a><br /></td></tr>
<tr class="separator:af19e574e7316fa0cb506f433a2b266f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a01dc6757f6bb9bcc27593791631fc56f"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#a01dc6757f6bb9bcc27593791631fc56f">precision</a> = 1000ll*1000ll*1000ll*1000ll*1000ll</td></tr>
<tr class="memdesc:a01dc6757f6bb9bcc27593791631fc56f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Precision of the price.  <a href="#a01dc6757f6bb9bcc27593791631fc56f">More...</a><br /></td></tr>
<tr class="separator:a01dc6757f6bb9bcc27593791631fc56f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a00f8a553edbab3956c82bdd37d435395"><td class="memItemLeft" align="right" valign="top">QuoteToken&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#a00f8a553edbab3956c82bdd37d435395">operator/</a> (BaseToken b, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;q)</td></tr>
<tr class="memdesc:a00f8a553edbab3956c82bdd37d435395"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operator returns a quote token given a base token and the conversion price.  <a href="#a00f8a553edbab3956c82bdd37d435395">More...</a><br /></td></tr>
<tr class="separator:a00f8a553edbab3956c82bdd37d435395"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3db8af0092dbe87a5dab8505052a750"><td class="memItemLeft" align="right" valign="top">BaseToken&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#ab3db8af0092dbe87a5dab8505052a750">operator*</a> (const QuoteToken &amp;b, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;q)</td></tr>
<tr class="memdesc:ab3db8af0092dbe87a5dab8505052a750"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operator returns a base token given a quote token and the conversion price.  <a href="#ab3db8af0092dbe87a5dab8505052a750">More...</a><br /></td></tr>
<tr class="separator:ab3db8af0092dbe87a5dab8505052a750"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a92923bb6a379671facc88b8f33e1f8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#a9a92923bb6a379671facc88b8f33e1f8">operator&lt;=</a> (const <a class="el" href="structeosio_1_1price.html">price</a> &amp;a, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;b)</td></tr>
<tr class="memdesc:a9a92923bb6a379671facc88b8f33e1f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Less than or equal to comparison operator.  <a href="#a9a92923bb6a379671facc88b8f33e1f8">More...</a><br /></td></tr>
<tr class="separator:a9a92923bb6a379671facc88b8f33e1f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6a0b37090470580bca05624bd5da0a3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#aa6a0b37090470580bca05624bd5da0a3">operator&lt;</a> (const <a class="el" href="structeosio_1_1price.html">price</a> &amp;a, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;b)</td></tr>
<tr class="memdesc:aa6a0b37090470580bca05624bd5da0a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Less than comparison operator.  <a href="#aa6a0b37090470580bca05624bd5da0a3">More...</a><br /></td></tr>
<tr class="separator:aa6a0b37090470580bca05624bd5da0a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0f3fb89fde51f4f9b728e51b459abf6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#aa0f3fb89fde51f4f9b728e51b459abf6">operator&gt;=</a> (const <a class="el" href="structeosio_1_1price.html">price</a> &amp;a, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;b)</td></tr>
<tr class="memdesc:aa0f3fb89fde51f4f9b728e51b459abf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Greater than or equal to comparison operator.  <a href="#aa0f3fb89fde51f4f9b728e51b459abf6">More...</a><br /></td></tr>
<tr class="separator:aa0f3fb89fde51f4f9b728e51b459abf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d386990660f40b6cd35f5da903b9d3e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#a1d386990660f40b6cd35f5da903b9d3e">operator&gt;</a> (const <a class="el" href="structeosio_1_1price.html">price</a> &amp;a, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;b)</td></tr>
<tr class="memdesc:a1d386990660f40b6cd35f5da903b9d3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Greater than comparison operator.  <a href="#a1d386990660f40b6cd35f5da903b9d3e">More...</a><br /></td></tr>
<tr class="separator:a1d386990660f40b6cd35f5da903b9d3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64a97e029f909397f7e93ae9f18c0f92"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#a64a97e029f909397f7e93ae9f18c0f92">operator==</a> (const <a class="el" href="structeosio_1_1price.html">price</a> &amp;a, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;b)</td></tr>
<tr class="memdesc:a64a97e029f909397f7e93ae9f18c0f92"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equality comparison operator.  <a href="#a64a97e029f909397f7e93ae9f18c0f92">More...</a><br /></td></tr>
<tr class="separator:a64a97e029f909397f7e93ae9f18c0f92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb4eb2338acf95c043151f4f35b99432"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeosio_1_1price.html#afb4eb2338acf95c043151f4f35b99432">operator!=</a> (const <a class="el" href="structeosio_1_1price.html">price</a> &amp;a, const <a class="el" href="structeosio_1_1price.html">price</a> &amp;b)</td></tr>
<tr class="memdesc:afb4eb2338acf95c043151f4f35b99432"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inequality comparison operator.  <a href="#afb4eb2338acf95c043151f4f35b99432">More...</a><br /></td></tr>
<tr class="separator:afb4eb2338acf95c043151f4f35b99432"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename BaseToken, typename QuoteToken&gt;<br />
struct eosio::price&lt; BaseToken, QuoteToken &gt;</h3>

<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">BaseToken</td><td>- represents the type of the base token </td></tr>
    <tr><td class="paramname">QuoteToken</td><td>- represents the type of the quote token</td></tr>
  </table>
  </dd>
</dl>
<p>Defines a fixed precision price between two tokens. A price is written as X Base/Quote. Where X is a power of 10 which makes it simpler to just shift the decimal. It supports the following operator: /, \, &lt;=, &lt;, ==, !=, &gt;=, &gt; and also print functionality</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="keyword">typedef</span> <a class="code" href="structeosio_1_1token.html">eosio::token&lt;uint64_t, N(MyBaseToken)&gt;</a> MyBaseToken;</div><div class="line"><span class="keyword">typedef</span> <a class="code" href="structeosio_1_1token.html">eosio::token&lt;uint64_t, N(MyQuoteToken)&gt;</a> MyQuoteToken;</div><div class="line"><span class="keyword">typedef</span> price&lt;MyBaseToken, MyQuoteToken&gt; MyBaseToQuotePrice;</div><div class="line">MyBaseToken zeroBaseToken;</div><div class="line">MyQuoteToken zeroQuoteToken;</div><div class="line">MyBaseToQuotePrice zeroBaseToQuote(zeroBaseToken, zeroQuoteToken); <span class="comment">// throws invalid price exception</span></div><div class="line">MyBaseToken baseToken(128);</div><div class="line">MyQuoteToken quoteToken(128);</div><div class="line">MyBaseToQuotePrice aPrice(baseToken, quoteToken);</div><div class="line">aPrice.print(); <span class="comment">// Output: 1e+15. MyBaseToken / MyQuoteToken</span></div><div class="line">MyQuoteToken anotherQuote = baseToken / <a class="code" href="structeosio_1_1price.html#a1883a4c7ea7945e3b9adc6e0ad935fa6">price</a>;</div><div class="line">std::cout &lt;&lt; (anotherQuote == quoteToken); <span class="comment">// Output: true</span></div><div class="line">MyBaseToken anotherBase = quoteToken * <a class="code" href="structeosio_1_1price.html#a1883a4c7ea7945e3b9adc6e0ad935fa6">price</a>;</div><div class="line">std::cout &lt;&lt; (anotherBase == baseToken); <span class="comment">// Output: true</span></div><div class="line">MyBaseToQuotePrice anotherPrice(baseToken, quoteToken);</div><div class="line">std::cout &lt;&lt; (aPrice == anotherPrice); <span class="comment">// Output: true</span></div><div class="line">std::cout &lt;&lt; (aPrice != anotherPrice); <span class="comment">// Output: false</span></div><div class="line">MyBaseToken base256(256);</div><div class="line">MyBaseToQuotePrice price2(base256, quoteToken);</div><div class="line">std::cout &lt;&lt; (price2 &gt; aPrice); <span class="comment">// Output: true</span></div><div class="line">std::cout &lt;&lt; (aPrice &lt; price2); <span class="comment">// Output: true</span></div></div><!-- fragment --> </div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a50171d60c92837867ed507a247d8a550"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a50171d60c92837867ed507a247d8a550">&#9670;&nbsp;</a></span>base_token_type</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef BaseToken <a class="el" href="structeosio_1_1price.html">eosio::price</a>&lt; BaseToken, QuoteToken &gt;::<a class="el" href="structeosio_1_1price.html#a50171d60c92837867ed507a247d8a550">base_token_type</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aef7d0e4f45187d59ebc40b0d91a1d358"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef7d0e4f45187d59ebc40b0d91a1d358">&#9670;&nbsp;</a></span>quote_token_type</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef QuoteToken <a class="el" href="structeosio_1_1price.html">eosio::price</a>&lt; BaseToken, QuoteToken &gt;::<a class="el" href="structeosio_1_1price.html#aef7d0e4f45187d59ebc40b0d91a1d358">quote_token_type</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a1883a4c7ea7945e3b9adc6e0ad935fa6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1883a4c7ea7945e3b9adc6e0ad935fa6">&#9670;&nbsp;</a></span>price() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeosio_1_1price.html">eosio::price</a>&lt; BaseToken, QuoteToken &gt;::<a class="el" href="structeosio_1_1price.html">price</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Default constructor. Initialize base per quote to be 1. </p>

</div>
</div>
<a id="af19e574e7316fa0cb506f433a2b266f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af19e574e7316fa0cb506f433a2b266f1">&#9670;&nbsp;</a></span>price() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeosio_1_1price.html">eosio::price</a>&lt; BaseToken, QuoteToken &gt;::<a class="el" href="structeosio_1_1price.html">price</a> </td>
          <td>(</td>
          <td class="paramtype">BaseToken&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QuoteToken&#160;</td>
          <td class="paramname"><em>quote</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construction for price given the base token and quote token. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>- base token </td></tr>
    <tr><td class="paramname">quote</td><td>- quote token </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="afb4eb2338acf95c043151f4f35b99432"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb4eb2338acf95c043151f4f35b99432">&#9670;&nbsp;</a></span>operator!=</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Inequality comparison operator. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>price to be compared </td></tr>
    <tr><td class="paramname">b</td><td>price to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if base per quote of a is not equal to base per quote of b </dd></dl>

</div>
</div>
<a id="ab3db8af0092dbe87a5dab8505052a750"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3db8af0092dbe87a5dab8505052a750">&#9670;&nbsp;</a></span>operator*</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">BaseToken operator* </td>
          <td>(</td>
          <td class="paramtype">const QuoteToken &amp;&#160;</td>
          <td class="paramname"><em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Operator returns a base token given a quote token and the conversion price. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>- quote token </td></tr>
    <tr><td class="paramname">q</td><td>- price </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>base token </dd></dl>

</div>
</div>
<a id="a00f8a553edbab3956c82bdd37d435395"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00f8a553edbab3956c82bdd37d435395">&#9670;&nbsp;</a></span>operator/</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QuoteToken operator/ </td>
          <td>(</td>
          <td class="paramtype">BaseToken&#160;</td>
          <td class="paramname"><em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Operator returns a quote token given a base token and the conversion price. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>- base token </td></tr>
    <tr><td class="paramname">q</td><td>- price </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>quote token </dd></dl>

</div>
</div>
<a id="aa6a0b37090470580bca05624bd5da0a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6a0b37090470580bca05624bd5da0a3">&#9670;&nbsp;</a></span>operator<</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&lt; </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Less than comparison operator. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>price to be compared </td></tr>
    <tr><td class="paramname">b</td><td>price to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if base per quote of a is less than base per quote of b </dd></dl>

</div>
</div>
<a id="a9a92923bb6a379671facc88b8f33e1f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a92923bb6a379671facc88b8f33e1f8">&#9670;&nbsp;</a></span>operator<=</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&lt;= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Less than or equal to comparison operator. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>price to be compared </td></tr>
    <tr><td class="paramname">b</td><td>price to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if base per quote of a is less than or equal to base per quote of b </dd></dl>

</div>
</div>
<a id="a64a97e029f909397f7e93ae9f18c0f92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a64a97e029f909397f7e93ae9f18c0f92">&#9670;&nbsp;</a></span>operator==</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Equality comparison operator. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>price to be compared </td></tr>
    <tr><td class="paramname">b</td><td>price to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if base per quote of a is equal to base per quote of b </dd></dl>

</div>
</div>
<a id="a1d386990660f40b6cd35f5da903b9d3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d386990660f40b6cd35f5da903b9d3e">&#9670;&nbsp;</a></span>operator></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&gt; </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Greater than comparison operator. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>price to be compared </td></tr>
    <tr><td class="paramname">b</td><td>price to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if base per quote of a is greater than base per quote of b </dd></dl>

</div>
</div>
<a id="aa0f3fb89fde51f4f9b728e51b459abf6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0f3fb89fde51f4f9b728e51b459abf6">&#9670;&nbsp;</a></span>operator>=</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&gt;= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeosio_1_1price.html">price</a>&lt; BaseToken, QuoteToken &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Greater than or equal to comparison operator. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>price to be compared </td></tr>
    <tr><td class="paramname">b</td><td>price to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if base per quote of a is greater than or equal to base per quote of b </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a01dc6757f6bb9bcc27593791631fc56f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01dc6757f6bb9bcc27593791631fc56f">&#9670;&nbsp;</a></span>precision</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseToken , typename QuoteToken &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="el" href="structeosio_1_1price.html">eosio::price</a>&lt; BaseToken, QuoteToken &gt;::precision = 1000ll*1000ll*1000ll*1000ll*1000ll</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>The largest base 10 integer that can be represented with 53 bits of a double. This number keeps the math in range of JavaScript. By being a power of 10 it makes it easier for developers to read and interpret the integer by simply shifting the decimal. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>contracts/eoslib/<a class="el" href="token_8hpp_source.html">token.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
